package com.one.material.controller;


import com.lzh.webservice.clinet.MyWebService;
import com.lzh.webservice.clinet.MyWebService_Service;
import com.lzh.webservice.clinet.Orders;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("iso")
public class ISOMaterialController {
    @RequestMapping("test")
    public String sendMessage() {
        MyWebService webService = new MyWebService_Service().getMyWebServiceImplPort();

        return webService.sendMessage("测试");
    }


    /**
     * 获取标准订单
     *
     * @return String集合
     */
    @RequestMapping("getCode")
    public List<String> getOrders() {
        MyWebService webService = new MyWebService_Service().getMyWebServiceImplPort();
        List<Orders> orders = webService.getOrders(null);
        ArrayList<String> strings = new ArrayList<>();
        orders.forEach(res->{
            strings.add(res.getCode());
        });
        return strings;
    }

}
